$(function() {
    $('#btn-selectall').click(function() {
        $('#user-list').uiTable('selectAll');
    });
    $('#menu-del-user').click(function() {
        var ids = $('#user-list').uiTable('selected');
        if(ids.length == 0) {
            alert('请选择要删除的会员');
            return false;
        }
        if(!confirm('确定删除所选的会员?')) {
            return false;
        }
        ids = ids.join(',');
        window.location.href = $(this).attr('href') + '&uids=' + ids;
        return false;
    });
    $('.menu-active-user').click(function() {
        var ids = $('#user-list').uiTable('selected');
        if(ids.length == 0) {
            alert('请选择要处理的会员');
            return false;
        }
        if(!confirm('确定处理所选的会员?')) {
            return false;
        }
        ids = ids.join(',');
        window.location.href = $(this).attr('href') + '&uids=' + ids;
        return false;
    });
    
    $('.grant-user').click(function(){
    	var me = $(this),url = me.attr('href'),id=me.attr('id'),name = me.attr('data-content');
    	openTab(url,id,'会员授权【'+name+'】','icon_grant');
    	return false;
    });
}); 